import request from "./request";

const getHomeData = () => request.get('index/index')

//获取pop数据
const getSearchPopData = () => request.get('search/index')

//搜索框商品搜索
const getSearchProductData = (params) => request.get('goods/list',{params})

//搜索框商品搜索
const getSearchHelperData = (params) => request.get('search/helper',{params})
//清除历史记录

const cleanHistorySearch = () => request.post('search/clearhistory')

// 登录接口
const goLogin = (params) => request.post('auth/loginByWeb',params)

// 商品详情接口
const getGoodsDetail = (params) => request.get('goods/detail', {params})

// 相关产品接口
const getGoodsRelated = (params) => request.get('goods/related', {params})

// 相关产品接口
const getCartNum = () => request.get('cart/goodscount')

const addCart = (params) => request.post('cart/add',params)

const getCartData = () => request.get('cart/index')


const setCartChecked = (params) => request.post('cart/checked',params)

const setGoodsNumberStep = (params) => request.post('cart/update',params)

const deleteCartGoods = (params) => request.post('cart/delete',params)

export {getHomeData,getSearchPopData,getSearchProductData,getSearchHelperData,cleanHistorySearch,goLogin,getGoodsDetail,getGoodsRelated,
  getCartNum,addCart,getCartData,setCartChecked,setGoodsNumberStep,deleteCartGoods}
